package com.lyshop.jinding.utils;



import com.lyshop.jinding.BuildConfig;
import com.lyshop.jinding.bean.ClientBean;

import java.util.HashMap;

public class ClientUtil {

    private static HashMap<String, ClientBean> mClientMap = new HashMap<>();
    private static HashMap<String, ClientBean> mClientTestMap = new HashMap<>();

    private static ClientUtil mClientUtil = null;

    public static ClientUtil getInstance() {
        if (mClientUtil == null) {
            synchronized (ClientUtil.class) {
                if (mClientUtil == null) {
                    mClientUtil = new ClientUtil();
                    initClientMap();
                }
            }
        }
        return mClientUtil;
    }

    private static void initClientMap() {
        mClientMap.put("ceshi", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientMap.put("xiaomi", new ClientBean(2, "3df87f9e626ab5d920b460b8a4fb38bb"));
        mClientMap.put("rongyao", new ClientBean(3, "2d32f2a6c9294a3dccbbe5a6ab89d8b2"));
        mClientMap.put("guanwang", new ClientBean(5, "847652d1d88d2c774b992fff9e113d75"));
        mClientMap.put("tuiguang", new ClientBean(6, "0a9738ea2aa469a5f45fd534830c8f5d"));
        mClientMap.put("yingyongbao", new ClientBean(7, "2d673912328262fa81968b83c5badcb0"));
        mClientMap.put("vivo", new ClientBean(8, "b09207f5c299c42708e1badb72c04025"));
        mClientMap.put("huawei", new ClientBean(9, "d63e7ea059dc68e97e2ef16531e47e6c"));
        mClientMap.put("oppo", new ClientBean(10, "c892ba238c98835d4d53a3faed43ee52"));
        mClientMap.put("sanliuling", new ClientBean(11, "fc22af41cf6b551afe338f432de52840"));
        mClientMap.put("baidu", new ClientBean(12, "844f52376cc31501b83280c7d956d941"));
        mClientMap.put("toutiao", new ClientBean(13, "a2265a2f0ef1d1c8298846ea2546b15c"));
        mClientMap.put("jindingtoutiao", new ClientBean(15, "8c0a9e073ae6fba542c484edad0427ab"));

        mClientTestMap.put("ceshi", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientTestMap.put("xiaomi", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientTestMap.put("rongyao", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientTestMap.put("guanwang", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientTestMap.put("tuiguang", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientTestMap.put("yingyongbao", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientTestMap.put("vivo", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientTestMap.put("huawei", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientTestMap.put("oppo", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientTestMap.put("sanliuling", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientTestMap.put("baidu", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientTestMap.put("toutiao", new ClientBean(1, "bc71b84fd8d45ba7e998f4162e99e8d2"));
        mClientTestMap.put("jindingtoutiao", new ClientBean(15, "8c0a9e073ae6fba542c484edad0427ab"));

    }


    public ClientBean getClientBean(String key) {
        return BuildConfig.SERVER_TYPE.equals("prod") ? mClientMap.get(key) : mClientTestMap.get(key);
    }
}
